package com.threeox.commonlibrary.ui.dialog.impl;

import android.app.Dialog;
import android.view.View;

import com.threeox.commonlibrary.ui.dialog.emnu.CommonButtonType;

/**
 *
 * @ClassName: ICommonDialogBuilder
 *
 * @Description: Todo()
 *
 * @author 赵屈犇
 *
 * @date 创建时间:2019/6/19 17:36
 * 
 * @version 1.0
 */
public interface ICommonDialogBuilder {


    /**
     * 初始化dialog
     *
     * @return
     */
    ICommonDialogBuilder initDialog();

    /**
     * 设置标题文字
     *
     * @param title
     * @return
     */
    ICommonDialogBuilder setTitle(Object title);

    /**
     * 获取标题文字
     *
     * @return
     */
    String getTitle();

    /**
     * 设置标题View
     *
     * @param view
     * @return
     */
    ICommonDialogBuilder setTitleView(View view);

    /**
     * 设置标题Layout
     *
     * @param layoutId
     * @return
     */
    ICommonDialogBuilder setTitleLayout(int layoutId);

    /**
     * 设置内容文字
     *
     * @param content
     * @return
     */
    ICommonDialogBuilder setContent(Object content);

    /**
     * 设置内容view
     *
     * @param view
     * @return
     */
    ICommonDialogBuilder setContentView(View view);

    /**
     * 设置内容layout
     *
     * @param layoutId
     * @return
     */
    ICommonDialogBuilder setContentLayout(int layoutId);

    /**
     * 是否展示弹窗
     *
     * @return
     */
    boolean isShowing();

    /**
     * 展示弹窗
     *
     * @return
     */
    ICommonDialogBuilder show();

    /**
     * 隐藏弹窗
     *
     * @return
     */
    ICommonDialogBuilder dismiss();


    /**
     * 隐藏按钮
     *
     * @param buttonType
     * @return
     */
    ICommonDialogBuilder hideButton(CommonButtonType buttonType);

    /**
     * 设置是否展示按钮
     *
     * @return
     */
    ICommonDialogBuilder setShowButtonLayout(boolean isShow);

    /**
     * 设置左边按钮的文字和点击事件
     *
     * @param leftText
     * @param listener
     * @return
     */
    ICommonDialogBuilder setLeftButton(Object leftText, CommonDialogClickListener listener);

    /**
     * 设置右边按钮的文字和点击事件
     *
     * @param rightText
     * @param listener
     * @return
     */
    ICommonDialogBuilder setRightButton(Object rightText, CommonDialogClickListener listener);

    /**
     * 设置中间按钮的文字和点击事件
     *
     * @param centerText
     * @param listener
     * @return
     */
    ICommonDialogBuilder setCenterButton(Object centerText, CommonDialogClickListener listener);

    /**
     * dialog 接口
     */

    /**
     *
     * @return
     */
    Dialog getDialog();

    /**
     *
     * @param isCancel
     * @return
     */
    ICommonDialogBuilder setCancelable(boolean isCancel);

    /**
     *
     * @param isCancel
     * @return
     */
    ICommonDialogBuilder setCanceledOnTouchOutside(boolean isCancel);

    /**
     * dialog 接口
     */

    /**
     *
     * @param id
     * @param <T>
     * @return
     */
    <T extends View> T findViewById(int id);
}
